<!-- calendar stylesheet -->
<link rel="stylesheet" type="text/css" media="all" href="jscalendar-0.9.3/calendar-win2k-cold-1.css" title="win2k-cold-1" />

<!-- main calendar program -->
<script type="text/javascript" src="jscalendar-0.9.3/calendar.js"></script>

<!-- language for the calendar -->
<script type="text/javascript" src="jscalendar-0.9.3/lang/calendar-en.js"></script>

<!-- the following script defines the Calendar.setup helper function, which makes
     adding a calendar a matter of 1 or 2 lines of code. -->
<script type="text/javascript" src="jscalendar-0.9.3/calendar-setup.js"></script>
<center><img src="imagens/agendamento.png"/></center><br /><br />
<form action="agenda_visitantes.php" method="POST" id="cadastro_visitantes">
    <fieldset style="line-height: 230%;">
        <b>RG:</b>
        <input id="rg" type="text" name="rg" size="10" onkeypress='return somentenumero(event)'/> 
        <input type="button" value="Busca por RG" id="busca_rg" onclick="busca_rg_cadastro()" /> <br />
        <b>Nome:</b>
        <input type="text" name="nome" id="nome" size="50" style="text-transform:uppercase;"  /> <br />
        <b>Sobrenome:</b>
        <input type="text" name="sobrenome" id="sobrenome"  size="50" style="text-transform:uppercase;"/> <br />
        <b>Empresa:</b>
        <input type="text" name="empresa" id="empresa"  size="50" style="text-transform:uppercase;" /> <br />
        <b>Placa</b>
        <input type="text" name="placa" id="placa" maxlength="8" onkeyup="separador(this)" style="text-transform:uppercase;"/><br />
        <b>Permissao:</b>
        <input type="text" name="permissao" value="<?php echo $_SESSION['login']; ?>" id="permissao" size="50" style="text-transform:uppercase;" readonly="true"/> <br />
        <div name="div_foto" id="div_foto" style="visibility:hidden">
        </div>
        <b>Setor:</b>
        <select name="setor" style="min-width: 150px">
            <?php
            $sql = "SELECT setor FROM setor WHERE bloqueado = 0 ORDER BY setor";
            $query = mysql_query($sql);
            echo "<option value = '*' > Selecione... </option>";
            while ($dados = mysql_fetch_array($query)) {
                echo "<option id=" . $dados['setor'] . " value = " . $dados['setor'] . ">" . $dados['setor'] . "</option>";
            }
            ?>        
        </select>
        <br />
        <b>Observação:</b>
        <input type="text" name="obs" id="obs"  size="50" style="text-transform:uppercase;" /> <br />
        <b>Data da entrada:</b>
        <input id="dt_ent" type="text" name="dt_ent" size="20" value='' onKeyUp="barra(this)" onBlur="VerificaData(this.value)"/>
        <img src="imagens/calendario.png" id="dt_cal1" style="cursor: pointer" title="Date selector" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" /><br />
        <script type="text/javascript">
            Calendar.setup({
                inputField     :    "dt_ent",      // id of the input field
                ifFormat       :    "dd/mm/y",       // format of the input field
                button         :    "dt_cal1",   // trigger for the calendar (button ID)
                singleClick    :    true            // double-click mode
            });
        </script>
        <b>Horario da entrada:</b>
        <input type="text" name="hr_ent" id="hr_ent"  size="4" style="text-transform:uppercase;" /> <br />

        <input type="submit" value="Enviar" />
        <input type="button" value="Limpar" onclick="javascript:window.history.go(0)"/>
    </fieldset>
</form>
<script>
    document.forms['cadastro_visitantes'].reset();
</script>
